import 'package:flutter/material.dart';

class InfoDialog {
  static Future<bool?> show( // 修改返回类型为 Future<bool?>
    BuildContext context,
    String title,
    String content,
  ) {
    return showDialog<bool>( // 添加泛型类型并返回对话框
        context: context,
        builder: (context) => AlertDialog(
              title: title != null ? Text(title) : null,
              content: content != null ? Text(content) : null,
              actions: [
                TextButton(
                    onPressed: () => Navigator.pop(context, true), // 返回 true 表示确认
                    child: const Text("确定")
                    )
              ],
            ));
  }
}
